#呼吸灯效果
from time import sleep
 
from machine import Pin, PWM
 
pwm = PWM(Pin(0, Pin.OUT))
 
pwm.freq(1000)
 
while True:
    for duty in range(65535):
        pwm.duty_u16(duty)
        sleep(0.0001)
    for duty in range(65535, 0, -1):
        pwm.duty_u16(duty)
        sleep(0.0001)